package com.howells.time.module.sendvideo.view;

import android.content.Context;
import android.widget.TextView;

import com.howells.time.R;
import com.howells.time.base.adapters.CommonAdapter;
import com.howells.time.base.adapters.ViewHolder;
import com.howells.time.module.sendvideo.model.Mode;

import java.util.List;

/**
 * Created by Administrator on 2016.4.15.
 */
public class ModeListAdapter extends CommonAdapter<Mode> {
    public ModeListAdapter(Context mContext, List<Mode> mData, int mItemLayoutId) {
        super(mContext, mData, mItemLayoutId);
    }

    @Override
    public void convert(ViewHolder helper, Mode item, int i) {
        //通过getView获取控件
        TextView textname = helper.getView(R.id.text_name);
        TextView textdiscription = helper.getView(R.id.text_discription);
        TextView texttime = helper.getView(R.id.text_time_max);

        //使用
        textname.setText(item.getName());
        textdiscription.setText(item.getDiscription());
        texttime.setText(String.valueOf(item.getSaveMaxTime()));
    }
}
